/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clientservice;

import java.math.BigInteger;

public class RSA {

    /**
     * Enrypt message
     * @param message String to encrypt (String must have only numbers)
     * @param publicKey - public key
     * @param modulus - the modulus of public key
     * @return String of encrypted text
     */
    public byte[] encrypt(byte[] message, String publicKey, String modulus) {
        BigInteger mes = new BigInteger(message);
        BigInteger Key = new BigInteger(publicKey); //public key
        BigInteger mod = new BigInteger(modulus); //modulus
        return mes.modPow(Key, mod).toByteArray();




    }
}
